<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.erl</title>
<meta name="generator" content="KF5::SyntaxHighlighting (Erlang)"/>
</head><body style="color:#1f1c1b"><pre>
<span style="color:#898887;">% testing for the erlang syntax highlighter</span>
<span style="color:#898887;">% </span><span style="color:#81ca2d;background-color:#f7e6e6;font-weight:bold;">NOTE</span><span style="color:#898887;"> alerts work in comments to </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold;">TODO</span><span style="color:#898887;"> !</span>

<span style="color:#898887;">% pragmas (show as keywords)</span>
<span style="font-weight:bold;">-module</span>
<span style="font-weight:bold;">-export</span>
<span style="font-weight:bold;">-define</span>
<span style="font-weight:bold;">-undef</span>
<span style="font-weight:bold;">-ifdef</span>
<span style="font-weight:bold;">-ifndef</span>
<span style="font-weight:bold;">-else</span>
<span style="font-weight:bold;">-endif</span>
<span style="font-weight:bold;">-include</span>
<span style="font-weight:bold;">-include</span>_lib

<span style="color:#898887;">% key words</span>
<span style="font-weight:bold;">after</span> <span style="font-weight:bold;">begin</span> <span style="font-weight:bold;">case</span> <span style="font-weight:bold;">catch</span> <span style="font-weight:bold;">cond</span>  <span style="font-weight:bold;">end</span> <span style="font-weight:bold;">fun</span> <span style="font-weight:bold;">if</span> <span style="font-weight:bold;">let</span> <span style="font-weight:bold;">of</span> <span style="font-weight:bold;">query</span> <span style="font-weight:bold;">receive</span> <span style="font-weight:bold;">all_true</span> <span style="font-weight:bold;">some_true</span> 

<span style="color:#898887;">% operators</span>
div rem or xor bor bxor bsl bsr and band not bnot
+ - * / == /= =:= =/= &lt; =&lt; &gt; &gt;= ++ -- = ! &lt;-

<span style="color:#898887;">% separators (show as functions)</span>
<span style="color:#644a9b;">(</span> <span style="color:#644a9b;">)</span> <span style="color:#644a9b;">{</span> <span style="color:#644a9b;">}</span> <span style="color:#644a9b;">[</span> <span style="color:#644a9b;">]</span> <span style="color:#644a9b;">.</span> <span style="color:#644a9b;">:</span> <span style="color:#644a9b;">|</span> <span style="color:#644a9b;">||</span> <span style="color:#644a9b;">;</span> <span style="color:#644a9b;">,</span> <span style="color:#644a9b;">?</span> -&gt; <span style="color:#644a9b;">#</span>

<span style="color:#898887;">% functions - predefined (part of erlang module) - show as functions</span>
<span style="color:#644a9b;">abs</span> <span style="color:#644a9b;">accept</span> <span style="color:#644a9b;">alarm</span> <span style="color:#644a9b;">apply</span> <span style="color:#644a9b;">atom_to_list</span> <span style="color:#644a9b;">binary_to_list</span> <span style="color:#644a9b;">binary_to_term</span> <span style="color:#644a9b;">check_process_code</span>
<span style="color:#644a9b;">concat_binary</span> <span style="color:#644a9b;">date</span> <span style="color:#644a9b;">delete_module</span> <span style="color:#644a9b;">disconnect_node</span> <span style="color:#644a9b;">element</span> <span style="color:#644a9b;">erase</span> <span style="color:#644a9b;">exit</span> <span style="color:#644a9b;">float</span> <span style="color:#644a9b;">float_to_list</span>
<span style="color:#644a9b;">garbage_collect</span> <span style="color:#644a9b;">get</span> <span style="color:#644a9b;">get_keys</span> <span style="color:#644a9b;">group_leader</span> <span style="color:#644a9b;">halt</span> <span style="color:#644a9b;">hd</span> <span style="color:#644a9b;">integer_to_list</span> <span style="color:#644a9b;">is_alive</span> <span style="color:#644a9b;">is_atom</span> <span style="color:#644a9b;">is_binary</span>
<span style="color:#644a9b;">is_boolean</span> <span style="color:#644a9b;">is_float</span> <span style="color:#644a9b;">is_function</span> <span style="color:#644a9b;">is_integer</span> <span style="color:#644a9b;">is_list</span> <span style="color:#644a9b;">is_number</span> <span style="color:#644a9b;">is_pid</span> <span style="color:#644a9b;">is_port</span> <span style="color:#644a9b;">is_process_alive</span>
<span style="color:#644a9b;">is_record</span> <span style="color:#644a9b;">is_reference</span> <span style="color:#644a9b;">is_tuple</span> <span style="color:#644a9b;">length</span> <span style="color:#644a9b;">link</span> <span style="color:#644a9b;">list_to_atom</span> <span style="color:#644a9b;">list_to_binary</span> <span style="color:#644a9b;">list_to_float</span> <span style="color:#644a9b;">list_to_integer</span>
<span style="color:#644a9b;">list_to_pid</span> <span style="color:#644a9b;">list_to_tuple</span> <span style="color:#644a9b;">load_module</span> <span style="color:#644a9b;">loaded</span> <span style="color:#644a9b;">localtime</span> <span style="color:#644a9b;">make_ref</span> <span style="color:#644a9b;">module_loaded</span> <span style="color:#644a9b;">node</span> <span style="color:#644a9b;">nodes</span> <span style="color:#644a9b;">now</span>
<span style="color:#644a9b;">open_port</span> <span style="color:#644a9b;">pid_to_list</span> <span style="color:#644a9b;">port_close</span> <span style="color:#644a9b;">port_command</span> <span style="color:#644a9b;">port_connect</span> <span style="color:#644a9b;">port_control</span> <span style="color:#644a9b;">ports</span> <span style="color:#644a9b;">pre_loaded</span> <span style="color:#644a9b;">process_flag</span>
<span style="color:#644a9b;">process_info</span> <span style="color:#644a9b;">processes</span> <span style="color:#644a9b;">purge_module</span> <span style="color:#644a9b;">put</span> <span style="color:#644a9b;">register</span> <span style="color:#644a9b;">registered</span> <span style="color:#644a9b;">round</span> <span style="color:#644a9b;">self</span> <span style="color:#644a9b;">setelement</span> <span style="color:#644a9b;">size</span>
<span style="color:#644a9b;">spawn</span> <span style="color:#644a9b;">spawn_link</span> <span style="color:#644a9b;">spawn_opt</span> <span style="color:#644a9b;">split_binary</span> <span style="color:#644a9b;">statistics</span> <span style="color:#644a9b;">term_to_binary</span> <span style="color:#644a9b;">throw</span> <span style="color:#644a9b;">time</span> <span style="color:#644a9b;">tl</span> <span style="color:#644a9b;">trunc</span> <span style="color:#644a9b;">tuple_to_list</span>
<span style="color:#644a9b;">unlink</span> <span style="color:#644a9b;">unregister</span> <span style="color:#644a9b;">whereis</span>

<span style="color:#898887;">% functions - inferred</span>
<span style="color:#644a9b;">module:function</span>
<span style="color:#644a9b;">function</span><span style="color:#644a9b;">()</span>

<span style="color:#898887;">% atoms (show as &quot;char&quot;)</span>
<span style="color:#898887;">% begin with underscore, lowercase, contain numbers letters and @ - or anything between ''</span>
<span style="color:#924c9d;">middle_underscore</span>
<span style="color:#924c9d;">abc</span> <span style="color:#924c9d;">ab4d</span> <span style="color:#924c9d;">a@cd8</span> <span style="color:#924c9d;">a@</span>
<span style="color:#924c9d;">'And this is (\012) an atom \'</span> <span style="color:#0057ae;">Atoo</span><span style="color:#924c9d;">' Variable 'atom</span> <span style="color:#924c9d;">again' </span>

<span style="color:#898887;">% variables (begin with capital letter or underscore, contain numbers, letters and @)</span>
<span style="color:#0057ae;">_leadingUnderscore</span> <span style="color:#0057ae;">AbdD@</span> <span style="color:#0057ae;">B45@c</span>

<span style="color:#898887;">% this is a string </span>
<span style="color:#bf0303;">&quot;a string sits between \&quot;</span> <span style="color:#924c9d;">double</span> <span style="color:#924c9d;">quotes</span><span style="color:#bf0303;">&quot; atom &quot;</span><span style="color:#924c9d;">more</span> <span style="color:#924c9d;">string</span><span style="color:#bf0303;">&quot;</span>

<span style="color:#898887;">% integers (decimal)</span>
<span style="color:#b08000;">1</span><span style="color:#644a9b;">.</span> <span style="color:#b08000;">234</span> <span style="color:#b08000;">$A</span>

<span style="color:#898887;">% integers (specified base)</span>
<span style="color:#b08000;">2#10101</span> <span style="color:#b08000;">34#567</span>

<span style="color:#898887;">% float</span>
<span style="color:#b08000;">12.23</span> <span style="color:#b08000;">12.9e-67</span> <span style="color:#b08000;">12.8E+89</span> <span style="color:#b08000;">33.34e89</span>

<span style="color:#898887;">% and finally some real code, so we can see what it looks like...</span>
<span style="font-weight:bold;">-module</span><span style="color:#644a9b;">(</span><span style="color:#924c9d;">codetest</span><span style="color:#644a9b;">).</span>			<span style="color:#898887;">% everything is in a module</span>
<span style="font-weight:bold;">-export</span><span style="color:#644a9b;">([</span><span style="color:#924c9d;">fac</span>/<span style="color:#b08000;">1</span><span style="color:#644a9b;">]).</span>		<span style="color:#898887;">% name and number of arguments - need this to be called outside of the module</span>

<span style="color:#644a9b;">fac</span><span style="color:#644a9b;">(</span><span style="color:#0057ae;">N</span><span style="color:#644a9b;">)</span> <span style="color:#924c9d;">when</span> <span style="color:#0057ae;">N</span> &gt; <span style="color:#b08000;">0</span>  -&gt; <span style="color:#0057ae;">N</span> * <span style="color:#644a9b;">fac</span><span style="color:#644a9b;">(</span><span style="color:#0057ae;">N</span>-<span style="color:#b08000;">1</span><span style="color:#644a9b;">);</span>
<span style="color:#644a9b;">fac</span><span style="color:#644a9b;">(</span><span style="color:#0057ae;">N</span><span style="color:#644a9b;">)</span> <span style="color:#924c9d;">when</span> <span style="color:#0057ae;">N</span> == <span style="color:#b08000;">0</span> -&gt; <span style="color:#b08000;">1</span><span style="color:#644a9b;">.</span>
</pre></body></html>
